<?php

/**
 * CreateSpaceForm class.
 * CreateForm is the data structure for keeping
 * createSpace form data. It is used by the 'login' action of 'SiteController'.
 */
class CreateSpaceFormModel extends CFormModel {

    public $spaceId;
    public $spaceName;
    public $mySpaceId;
    public $spaceCategory;
    public $apps;
    public $spaceRole;

    /**
     * Declares the validation rules.
     * The rules state that username and password are required,
     * and password needs to be authenticated.
     */
    public function rules() {
        return array(
            // username and password are required
            array('mySpaceId,spaceName, spaceCategory', 'required', 'on' => 'CreateSpace'),
            //array('Apps', 'required', 'on' => 'AddApplication'),
            array('spaceRole, apps', 'safe'),
                // array('Apps', 'required'),
        );
    }

    /**
     * Declares attribute labels.
     */
    public function attributeLabels() {
        return array(
            'mySpaceId' => 'My Space ID',
            'spaceName' => 'Space Name',
            'spaceCategory' => 'Space Category',
            'spaceRole' => 'Space Roles',
            'apps' => 'Space Applications List:',
        );
    }

}
